/* Stack implementation using array */
#include <cstdlib>
#include <iostream.h>
#include <conio.h>
#include <algorithm>

using namespace std;
void pause() __attribute__((destructor)); /* Function Declaration, You Cannot Declare Attributes Without This */
void pause(){ getch(); }

/* The Stack class */
class Stack
{
    public:
        Stack() { size = 10; current = -1;} //constructor
        int pop(){ return A[current--];} // The pop function
        void push(int x){A[++current] = x;} // The push function
        int top(){ return A[current];} // The top function
        int isEmpty(){return ( current == -1 );} // Will return true when stack is empty
        int isFull(){ return ( current == size-1);} // Will return true when stack is full
    private:
        int object; // The data element
        int current; // Index of the array
        int size; // max size of the array
        int A[10]; // Array of 10 elements
};
// The main method
int main()
{
    Stack stack; // creating a stack object
    while( not end of input ) {
        c = next input character;
        if( c is an operand )
            add c to postfix string;
        else {
            while( !s.empty() && prcd(s.top(),c) ){
                op = s.pop();
                add op to the postfix string;
            }
            s.push( c );
        }
        while( !s.empty() ) {
        op = s.pop();
        add op to postfix string;
    }
    /*
    for(int i = 0; i < 12; i++)
    {
        if(!stack.isFull())
            stack.push(i);
        else
            cout <<"\n Stack is full, can't insert new element";
    }
    for (int i = 0; i < 12; i++)
    {
        if(!stack.isEmpty())
            cout << "\n The popped element = " << stack.pop();
        else
            cout <<"\n Stack is empty, can't pop";
    }
    */
    
    return EXIT_SUCCESS;
}
